<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel=stylesheet type="text/css" href="css/main.css">
<link rel=stylesheet type="text/css" href="css/introduction.css">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" href="img/favicon.ico" type="image/x-icon" />
<script src="js/jquery-1.8.0.min.js" type="text/javascript"></script>
<script src="js/message.js" type="text/javascript"></script>
<title>最新消息</title>
</head>
<body background="img/background_color.gif">
<?php 
include("Top.php"); 
include("menu.php"); 
?>
<table cellpadding="0" cellspacing="0" width="100%" background="img/background_color.gif" >
  <tr>
    <td>
    <table cellpadding="0" cellspacing="0" width="1000" background="img/context_background.gif" align="center">
      <tr valign="top">
        <td align="left" height="25">
        </td>
      </tr>
      <tr>
        <td align="center">
        <table cellpadding="0" cellspacing="0" width="900">
          <tr valign="top">
            <td align="left">
            <img src="img/news_title.jpg" border="0" />
            </td>
          </tr>
        </table>
        </td>
      </tr>
      <tr>
        <td align="center">
        <table cellpadding="0" cellspacing="0" width="900" class="contenttable">
		<tr>
		<td valign="top" height="380">
		  <table cellpadding="0" cellspacing="0" width="100%">
				
<?php 
require_once("class/NewsList.php");
$newlist = new NewsList(15); 
if (isset($_REQUEST['page'])){
	$page = $_REQUEST['page'];
}else{
	$page = 1;
}

$result = $newlist->getNews($page);

foreach($result as $row){  
  echo "<tr valign='top'>
                 <td width='30'' align='left'>
                 &nbsp;<img src='./img/header.gif' border='0' />
                 </td>";
  echo "<td width='120' align='left'>";
  echo date('Y-m-d', strtotime($row['updated_date'])) . ''; 
  echo "</td><td align='left'>";
  echo "<span class='span_subject'>" . $row['subject'] . "</span>"; 
  echo "<div class='div_message'><pre>" . $row['message'] . "</pre></div>"; 
  echo "</td>";
  echo "<td width='30'>";
  if($row['filename'] != null) { 
    echo "<a href='download.php?nid=" . $row['nid'] . "&filename=" . $row['filename'] . "'>";
    echo "<img alt='img_file' src='./img/file.png'/>"; 
	echo "</a>";
  }
  echo "</td>";
  echo "</tr>";
} 
  
?>
</table>
</td>
</tr>
      <tr valign="middle">
	    <td height="50" align="left" colspan="3">
<?php
	for($i=1; $i<=$newlist->getPage(); $i++){
		echo "<a class='infPage' href='news.php?page=" . $i . "'>" . $i . "</a>";
	}
?>
            </td>
          </tr>
			</table>
			
				</td>
			</tr>
			<tr>
        <td height="25" align="left">
        </td>
      </tr>
		</table>
        </td>
      </tr>
      
    </table>
    </td>
  </tr>
</table>
<?php 
include("Footer.php"); 
?>
</body>
</html>